<template>
  <div class="app-container">
    <el-container>
      <el-aside width="220px">
        <el-header style="height: 26px; font-size: 14px"> </el-header>
        <el-menu :default-active="activeCat">
          <el-menu-item v-for="cat of catalogs" :key="cat.key" :index="cat.key">
            <i :class="cat.icon"></i>{{ cat.name }}
          </el-menu-item>
        </el-menu>
      </el-aside>

      <div class="w-1/2 ml-20">
        <el-container>
          <el-header class="text-sm">
            <el-input placeholder="在设置中搜索">
              <i class="el-icon-search el-input__icon" slot="prefix"> </i>
            </el-input>
          </el-header>

          <el-main>
            <div class="text-sm" v-for="item of items" :key="item.key">
              <div class="mb-4">{{ item.title }}</div>
              <setting-box>
                <component :is="item.componentName"></component>
              </setting-box>
            </div>
          </el-main>
        </el-container>
      </div>
    </el-container>
  </div>
</template>

<script>
import SettingBox from "./components/SettingBox.vue";
import LoginPass from "./components/LoginPass.vue";

export default {
  components: {
    SettingBox,
    LoginPass,
  },
  data() {
    return {
      catalogs: [
        {
          key: "security",
          name: "安全和隐私",
          icon: "el-icon-umbrella",
        },
      ],
      activeCat: "security",
      items: [
        {
          key: "security",
          title: "登录密码",
          componentName: "LoginPass",
        },
      ],
    };
  },
};
</script>

<style lang="scss" scoped>
.app-container {
  .el-menu {
    border: none;
  }
  .el-menu-item {
    background-color: white !important;
  }
  button {
    outline: none;
  }
}
</style>